<template>
	<view>

		<u--form labelPosition='top' labelWidth='700rpx' :model="formState" name="basic" layout="horizontal"
			:labelCol="{span:7}" :wrapperCol="{span: 13, offset: 0}">
			<u-collapse :value="['1','2','3','4']" ref="coll">
				<u-collapse-item name="1" title="现场检查评分表" icon="https://cdn.uviewui.com/uview/example/cell.png">

					<!-- <tbody> -->
					<u-row>
						<u-col span="2">检查项目</u-col>
						<u-col span="2"></u-col>
						<u-col span="2">检查要点</u-col>
						<u-col span="2">满分</u-col>
						<u-col span="2">得分</u-col>
						<u-col span="2">扣分原因</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="2">光缆交接箱（一级分纤箱）安装</u-col>
						<u-col span="2">整体</u-col>
						<u-col span="2">安装位置与设计文件一致，箱体端正、牢固、不晃动，无明显歪斜。</u-col>
						<u-col span="2">12</u-col>
						<u-col span="2">
							<u--input type="number" v-model="formmark.s1" :max="12" @change="sumMark" :min="0">
							</u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.m1"></u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="2"></u-col>
						<u-col span="2">门锁</u-col>
						<u-col span="2">光交接箱整洁牢固、门锁开启灵活可靠。</u-col>
						<u-col span="2">6</u-col>
						<u-col span="2">
							<u--input type="number" v-model="formmark.s2" @change="sumMark" :min="0" :max="6">
							</u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.m2"></u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="2"></u-col>
						<u-col span="2">标识</u-col>
						<u-col span="2">箱体标牌标示符合施工规范</u-col>
						<u-col span="2">8</u-col>
						<u-col span="2">
							<u--input type="number" v-model="formmark.s3" @change="sumMark" :min="0" :max="8">
							</u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.m3"></u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="2"></u-col>
						<u-col span="2">布线</u-col>
						<u-col span="2">箱体布线符合施工规范</u-col>
						<u-col span="2">6</u-col>
						<u-col span="2">
							<u--input type="number" v-model="formmark.s4" @change="sumMark" :min="0" :max="6">
							</u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.m4"></u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="2"></u-col>
						<u-col span="2">接地</u-col>
						<u-col span="2">接地线保护连接符合要求</u-col>
						<u-col span="2">6</u-col>
						<u-col span="2">
							<u--input type="number" v-model="formmark.s5" @change="sumMark" :min="0" :max="6">
							</u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.m5"></u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="2"></u-col>
						<u-col span="2">防尘</u-col>
						<u-col span="2">按规定做好防潮封堵</u-col>
						<u-col span="2">6</u-col>
						<u-col span="2">
							<u--input type="number" v-model="formmark.s6" @change="sumMark" :min="0" :max="6">
							</u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.m6"></u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="2"></u-col>
						<u-col span="2">法兰防尘</u-col>
						<u-col span="2">空余法兰盘需全部有防尘帽</u-col>
						<u-col span="2">6</u-col>
						<u-col span="2">
							<u--input type="number" v-model="formmark.s7" @change="sumMark" :min="0" :max="6">
							</u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.m7"></u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="2">二级（末级）分纤箱安装</u-col>
						<u-col span="2">位置</u-col>
						<u-col span="2">安装位置符合设计要求，合理，并与竣工图纸标识位置一致。</u-col>
						<u-col span="2">6</u-col>
						<u-col span="2">
							<u--input type="number" v-model="formmark.s8" @change="sumMark" :min="0" :max="6">
							</u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.m8"></u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="2"></u-col>
						<u-col span="2">固定</u-col>
						<u-col span="2">箱体、内附件及光缆加强芯要固定良好。</u-col>
						<u-col span="2">4</u-col>
						<u-col span="2">
							<u--input type="number" v-model="formmark.s9" @change="sumMark" :min="0" :max="4">
							</u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.m9"></u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="2"></u-col>
						<u-col span="2">门锁</u-col>
						<u-col span="2">箱体安装牢固，无松动现象。门锁良好，开关自如。</u-col>
						<u-col span="2">2</u-col>
						<u-col span="2">
							<u--input type="number" v-model="formmark.s10" @change="sumMark" :min="0" :max="2">
							</u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.m10"></u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="2"></u-col>
						<u-col span="2">走线</u-col>
						<u-col span="2">箱内走线符合设计要求，光缆成端符合设计规范，标识清晰。</u-col>
						<u-col span="2">2</u-col>
						<u-col span="2">
							<u--input type="number" v-model="formmark.s11" @change="sumMark" :min="0" :max="2">
							</u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.m11"></u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="2"></u-col>
						<u-col span="2">余纤</u-col>
						<u-col span="2">光纤全部接续完成后应将余纤盘在盘纤槽内，盘绕方向应一致；走线要美观，标签要规范。已布放好的光纤但未启用时，光连接头应用保护套保护。</u-col>
						<u-col span="2">4</u-col>
						<u-col span="2">
							<u--input type="number" v-model="formmark.s12" @change="sumMark" :min="0" :max="4">
							</u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.m12"></u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="2"></u-col>
						<u-col span="2">防尘</u-col>
						<u-col span="2">未使用法兰盘应用保护套保护。</u-col>
						<u-col span="2">4</u-col>
						<u-col span="2">
							<u--input type="number" v-model="formmark.s13" @change="sumMark" :min="0" :max="4">
							</u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.m13"></u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="2"></u-col>
						<u-col span="2">整洁</u-col>
						<u-col span="2">箱体内外整洁、不脏乱。</u-col>
						<u-col span="2">4</u-col>
						<u-col span="2">
							<u--input type="number" v-model="formmark.s14" @change="sumMark" :min="0" :max="4">
							</u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.m14" @change="sumMark" :min="0"></u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="2">分光器安装</u-col>
						<u-col span="2">安装</u-col>
						<u-col span="2">型号、安装方式符合设计规范及安装规范要求。</u-col>
						<u-col span="2">6</u-col>
						<u-col span="2">
							<u--input type="number" v-model="formmark.s15" @change="sumMark" :min="0" :max="6">
							</u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.m15"></u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="2"></u-col>
						<u-col span="2">尾纤</u-col>
						<u-col span="2">尾纤的盘留应整齐、有序，盘留的尾纤应便于取出。</u-col>
						<u-col span="2">4</u-col>
						<u-col span="2">
							<u--input type="number" v-model="formmark.s16" @change="sumMark" :min="0" :max="4">
							</u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.m16"></u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="2"></u-col>
						<u-col span="2">出纤</u-col>
						<u-col span="2">半径应大于30mm。</u-col>
						<u-col span="2">2</u-col>
						<u-col span="2">
							<u--input type="number" v-model="formmark.s17" @change="sumMark" :min="0" :max="2">
							</u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.m17"></u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="2"></u-col>
						<u-col span="2">防尘帽</u-col>
						<u-col span="2">未使用的接插器件应盖上防尘帽。</u-col>
						<u-col span="2">8</u-col>
						<u-col span="2">
							<u--input type="number" v-model="formmark.s18" @change="sumMark" :min="0" :max="8">
							</u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.m18"></u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="2"></u-col>
						<u-col span="2">标识</u-col>
						<u-col span="2">符合设计要求，制作标识。</u-col>
						<u-col span="2">4</u-col>
						<u-col span="2">
							<u--input type="number" v-model="formmark.s19" @change="sumMark" :min="0" :max="4">
							</u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.m19"></u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="2">小计</u-col>
						<u-col span="2"></u-col>
						<u-col span="2"></u-col>
						<u-col span="2">100</u-col>
						<u-col span="2">
							<u--input type="number" v-model="formmark.s20" :readonly="true"></u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.m20"></u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<!-- </tbody> -->

				</u-collapse-item>
				<u-collapse-item name="2" title="质量检测评分表" icon="https://cdn.uviewui.com/uview/example/keyboard.png">
					<!-- <view id="main-table" class="mytable"> -->
					<!-- <tbody> -->
					<u-row>
						<u-col span="1">序号</u-col>
						<u-col span="1">项目</u-col>
						<u-col span="2">检查的内容</u-col>
						<u-col span="1">分值</u-col>
						<u-col span="2">检查方式</u-col>
						<u-col span="2">检查情况</u-col>
						<u-col span="2"> 扣分原因</u-col>
						<u-col span="1">得分</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="1">1</u-col>
						<u-col span="1">一般规定要求</u-col>
						<u-col span="2">(1)不按要求编制施工组织方案的。</u-col>
						<u-col span="1">6</u-col>
						<u-col span="2">查资料</u-col>
						<u-col span="2">
							<u--input v-model="formmark.c1"></u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.cr1"></u--input>
						</u-col>
						<u-col span="1">
							<u--input type="number" v-model="formmark.cm1" @change="sumMark" :min="0" :max="6">
							</u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="1"></u-col>
						<u-col span="1"></u-col>
						<u-col span="2">(2)未按规定拆除施工临时标志的。</u-col>
						<u-col span="1">8</u-col>
						<u-col span="2">现场检查</u-col>
						<u-col span="2">
							<u--input v-model="formmark.c2"></u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.cr2"></u--input>
						</u-col>
						<u-col span="1">
							<u--input type="number" v-model="formmark.cm2" @change="sumMark" :min="0" :max="8">
							</u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="1">2</u-col>
						<u-col span="1">环境保护要求</u-col>
						<u-col span="2">(1)施工料具不按要求摆放，存放油料没有防止泄漏和污染措施的。</u-col>
						<u-col span="1">8</u-col>
						<u-col span="2">现场检查</u-col>
						<u-col span="2">
							<u--input v-model="formmark.c3"></u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.cr3"></u--input>
						</u-col>
						<u-col span="1">
							<u--input type="number" v-model="formmark.cm3" @change="sumMark" :min="0" :max="8">
							</u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="1"></u-col>
						<u-col span="1"></u-col>
						<u-col span="2">(2)施工人员未保持施工现场整洁，随意抛撒施工废料的。</u-col>
						<u-col span="1">8</u-col>
						<u-col span="2">现场检查</u-col>
						<u-col span="2">
							<u--input v-model="formmark.c4"></u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.cr4"></u--input>
						</u-col>
						<u-col span="1">
							<u--input type="number" v-model="formmark.cm4" @change="sumMark" :min="0" :max="8">
							</u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="1">3</u-col>
						<u-col span="1">安全管理要求</u-col>
						<u-col span="2">(1)在项目开工前未按要求安全技术交底，未并做好书面记录的。</u-col>
						<u-col span="1">6</u-col>
						<u-col span="2">查资料</u-col>
						<u-col span="2">
							<u--input v-model="formmark.c5"></u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.cr5"></u--input>
						</u-col>
						<u-col span="1">
							<u--input type="number" v-model="formmark.cm5" @change="sumMark" :min="0" :max="6">
							</u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="1"></u-col>
						<u-col span="1"></u-col>
						<u-col span="2">(2)在项目开工前未对施工现场存在的危险源进行识别，未采取必要的防范措施的。</u-col>
						<u-col span="1">6</u-col>
						<u-col span="2">现场检查</u-col>
						<u-col span="2">
							<u--input v-model="formmark.c6"></u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.cr6"></u--input>
						</u-col>
						<u-col span="1">
							<u--input type="number" v-model="formmark.cm6" @change="sumMark" :min="0" :max="6">
							</u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="1"></u-col>
						<u-col span="1"></u-col>
						<u-col span="2">(3)施工现场未设置施工标志牌的。</u-col>
						<u-col span="1">6</u-col>
						<u-col span="2">现场检查</u-col>
						<u-col span="2">
							<u--input v-model="formmark.c7"></u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.cr7"></u--input>
						</u-col>
						<u-col span="1">
							<u--input type="number" v-model="formmark.cm7" @change="sumMark" :min="0" :max="6">
							</u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="1"></u-col>
						<u-col span="1"></u-col>
						<u-col span="2">(4)施工现场未设置安全警示标志。</u-col>
						<u-col span="1">8</u-col>
						<u-col span="2">现场检查</u-col>
						<u-col span="2">
							<u--input v-model="formmark.c8"></u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.cr8"></u--input>
						</u-col>
						<u-col span="1">
							<u--input type="number" v-model="formmark.cm8" @change="sumMark" :min="0" :max="8">
							</u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="1"></u-col>
						<u-col span="1"></u-col>
						<u-col span="2">(5)对施工现场安全隐患不采取措施予以消除的。</u-col>
						<u-col span="1">8</u-col>
						<u-col span="2">现场检查</u-col>
						<u-col span="2">
							<u--input v-model="formmark.c9"></u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.cr9"></u--input>
						</u-col>
						<u-col span="1">
							<u--input type="number" v-model="formmark.cm9" @change="sumMark" :min="0" :max="8">
							</u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="1"></u-col>
						<u-col span="1"></u-col>
						<u-col span="2">(6)未采取保护措施，造成设备或线路损坏的。</u-col>
						<u-col span="1">8</u-col>
						<u-col span="2">现场检查</u-col>
						<u-col span="2">
							<u--input v-model="formmark.c10"></u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.cr10"></u--input>
						</u-col>
						<u-col span="1">
							<u--input type="number" v-model="formmark.cm10" @change="sumMark" :min="0" :max="8">
							</u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="1">4</u-col>
						<u-col span="1">施工现场通用管理 标准</u-col>
						<u-col span="2">(1)施工人员统一着装，佩带工作牌。</u-col>
						<u-col span="1">6</u-col>
						<u-col span="2">现场检查</u-col>
						<u-col span="2">
							<u--input v-model="formmark.c11"></u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.cr11"></u--input>
						</u-col>
						<u-col span="1">
							<u--input type="number" v-model="formmark.cm11" @change="sumMark" :min="0" :max="6">
							</u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="1"></u-col>
						<u-col span="1"></u-col>
						<u-col span="2">(2)配备齐全安全防护用品，安全帽、口罩、劳保手套等，并确保可靠。</u-col>
						<u-col span="1">6</u-col>
						<u-col span="2">现场检查</u-col>
						<u-col span="2">
							<u--input v-model="formmark.c12"></u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.cr12"></u--input>
						</u-col>
						<u-col span="1">
							<u--input type="number" v-model="formmark.cm12" @change="sumMark" :min="0" :max="6">
							</u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="1"></u-col>
						<u-col span="1"></u-col>
						<u-col span="2">(3)施工队长要对施工人员进行安全事项训示并形成施工日志。</u-col>
						<u-col span="1">6</u-col>
						<u-col span="2">查资料</u-col>
						<u-col span="2">
							<u--input v-model="formmark.c13"></u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.cr13"></u--input>
						</u-col>
						<u-col span="1">
							<u--input type="number" v-model="formmark.cm13" @change="sumMark" :min="0" :max="6">
							</u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="1">5</u-col>
						<u-col span="1">专业现场管理标准</u-col>
						<u-col span="2">是否符合附件2专业现场管理标准相关内容要求。</u-col>
						<u-col span="1">10</u-col>
						<u-col span="2">现场检查</u-col>
						<u-col span="2">
							<u--input v-model="formmark.c14"></u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.cr14"></u--input>
						</u-col>
						<u-col span="1">
							<u--input type="number" v-model="formmark.cm14" @change="sumMark" :min="0" :max="10">
							</u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<u-row>
						<u-col span="1"></u-col>
						<u-col span="1">合计</u-col>
						<u-col span="2"></u-col>
						<u-col span="1">100</u-col>
						<u-col span="2"></u-col>
						<u-col span="2">
							<u--input v-model="formmark.c15"></u--input>
						</u-col>
						<u-col span="2">
							<u--input v-model="formmark.cr15"></u--input>
						</u-col>
						<u-col span="1">
							<u--input type="number" v-model="formmark.cm15" @change="sumMark" :min="0" :readonly="true">
							</u--input>
						</u-col>
					</u-row>
					<u-divider></u-divider>
					<!-- </tbody> -->
					<!-- </view> -->
				</u-collapse-item>


				<u-collapse-item name="4" title="现场照片" icon="https://cdn.uviewui.com/uview/example/image.png">
					<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
						:maxCount="10"></u-upload>
				</u-collapse-item>
			</u-collapse>
		</u--form>
		<u-button type="primary" text="保存"  v-if="(user.Roles.indexOf('管理员') > -1 || user.Roles.indexOf('项目经理') > -1) && id==null" @click="save"></u-button>
		<u-notify ref="uNotify"></u-notify>
	</view>
</template>

<script>
	import {
		baseUrl
	} from '@/common/config.js'
	import {
		addbuildcheck,
		getbuildcheckbyid
	} from '@/common/api.js'
	import {
		mapGetters
	} from 'vuex'
	export default {
		data() {
			return {
				id:null,
				formState: {},
				fileList1: [],
				formmark: {},
				buildid:null,
				user: JSON.parse(uni.getStorageSync("$userinfo")),
			}
		},
		onLoad(option) {
			this.buildid=option.buildid
			this.id = option.id
			if(this.id)
			{
				this.getdata(this.id)
			}
			// this.getlist()
		},
		// computed: {
		// 	...mapGetters( ['user']),
		// },
		methods: {
			getdata(id)
			{
				getbuildcheckbyid(id).then(res=>{
					this.formState = res;
					this.formmark = JSON.parse(res.JsonResult) 
					setTimeout(()=>{
						this.$refs.coll.init()
					},500)
				})
			},
			save()
			{
				this.formState.JsonResult = JSON.stringify(this.formmark)
				this.formState.Buildid=this.buildid
				addbuildcheck(this.formState).then(res=>{
					this.$refs.uNotify.show(this.notifyData)
					uni.setStorageSync("changed","1")
					uni.navigateTo({
						url: "buildchecklist?buildid="+this.buildid
					})
				})

			},
			sumMark() {
				this.formmark.s20 = 0
				for (let i = 1; i < 20; i++) {
					if (this.formmark['s' + i])
						this.formmark.s20 += parseInt(this.formmark['s' + i])
				}
				this.formmark.cm15 = 0
				for (let i = 1; i < 15; i++) {
					if (this.formmark['cm' + i])
						this.formmark.cm15 += parseInt(this.formmark['cm' + i])
				}
				this.formState.Remark = "现场评分：" + this.formmark.s20 + ";质量评分：" + this.formmark.cm15
			},
			// 删除图片
			deletePic(event) {
				this[`fileList${event.name}`].splice(event.index, 1)
			},
			// 新增图片
			async afterRead(event) {
				// 当设置 mutiple 为 true 时, file 为数组格式，否则为对象格式
				let lists = [].concat(event.file)
				let fileListLen = this[`fileList${event.name}`].length
				lists.map((item) => {
					this[`fileList${event.name}`].push({
						...item,
						status: 'uploading',
						message: '上传中'
					})
				})
				for (let i = 0; i < lists.length; i++) {
					const result = await this.uploadFilePromise(lists[i].url)
					let item = this[`fileList${event.name}`][fileListLen]
					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
						status: 'success',
						message: '',
						url: result
					}))
					fileListLen++
				}
			},
			uploadFilePromise(url) {
				return new Promise((resolve, reject) => {
					let a = uni.uploadFile({
						url: `${baseUrl}/SysFile/upload?outid=${this.formState.Id||this.$store.getters.$userInfo.Id}&type=现场照片`, // 仅为示例，非真实的接口地址
						filePath: url,
						name: 'file',
						formData: {
							user: 'test'
						},
						success: (res) => {
							setTimeout(() => {
								resolve(res.data.data)
							}, 1000)
						}
					});
				})
			},
		}
	}
</script>

<style lang="less" scoped>
	.mytable {
		font-size: 14px;
		border: 1px solid #CCC;
		font-family: Arial, Helvetica, sans-serif;
		width: 100%;
		border-collapse: unset;
	}

	.mytable td {
		padding: 4px;
		margin: 3px;
		border: 1px solid #CCC;
	}

	.mytable th {
		background-color: #104E8B;
		color: #FFF;
		font-weight: bold;
	}
</style>
